    <style>
        .el-header {
            background-color: #ffffff;
            color: #333;
            line-height: 60px;
        }

        .el-aside {
            color: #333;
        }
        .el-row {
            margin-bottom: 20px;
        }
        ul li{
            list-style: none;

        }

        html {
            overflow-y: scroll;
        }
        :root {
            overflow-y: auto;
            overflow-x: hidden;
        }
        :root body {
            position: absolute;
        }
        body {
            width: 100vw;
            overflow: hidden;
        }
        .el-radio__inner{
            display: none;
        }
    </style>
    <!--修改订单，再次添加产品-->
<div id="erpOrderEditapp" v-cloak >
    <el-dialog
            :title="title"
            :visible.sync="showEdit"
            @open="setMemberId"
            @close="reback"
            fullscreen
    >
    <div  class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" style="width: auto;">
            <div class="row">
                <div class="col-md-4">
                    <div class="产品尺寸-group">
                        <div class="col-sm-4 control-label">订单号:</div>
                        <div class="col-sm-8">
                            <span>{{erpOrder.orderNo}}</span>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-4 control-label">下单时间:</div>
                        <div class="col-sm-8">
                            <span>{{erpOrder.createTime}}</span>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-2 control-label" ></div>
                        <div class="col-sm-10">
                            <span style="text-align: left; color: red">提示:要给顾客便宜100元，则输入"-100";要提高价格100元，则输入"100"</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
            <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-4 control-label">订单总额:</div>
                        <div class="col-sm-8">
                            <span>{{erpOrder.totalAmount}}</span>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-4 control-label">订单应付金额:</div>
                        <div class="col-sm-8">
                            <span>{{erpOrder.payableAmount}}</span>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-4 control-label">调价:</div>
                        <div class="col-sm-4">
                            <el-input v-model="erpOrder.discount" size="mini" placeholder="请输入金额"></el-input>
                        </div>
                        <div class="col-sm-4">
                            <el-button type="primary" size="mini" @click="updateDiscount">调价</el-button>
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-md-4">
                    <div class="产品尺寸-group">
                        <div class="col-sm-4 control-label">项目名称:</div>
                        <div class="col-sm-8">
                            <span>{{erpOrder.projectName}}</span>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <div class="col-sm-4 control-label">备注:</div>
                        <div class="col-sm-8">
                            <span>{{erpOrder.memo}}</span>
                        </div>
                    </div>
                </div>
            </div>
            <hr >

            <div style="margin-top: 5px;margin-left: 5px"><h4 style="color: #0f6ab4">订单详情</h4></div>
            <div class="form-group">
                <template>
                    <el-table border :data="detailData" style="width: 100%" size="small" >
                        <el-table-column type="expand">
                            <template slot-scope="props" v-if="props.row.productInfoParamList">
                                <el-table
                                        :data="props.row.productInfoParamList"
                                        style="width: 90%">
                                    <el-table-column label="部件名称" prop="partsName" align="center"></el-table-column>
                                    <el-table-column label="规格/尺寸/材质/工艺" width="700" prop="basicParamStr" align="center"></el-table-column>
                                    <el-table-column label="尺寸" align="center">
                                        <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                        {{props.row.cutModelObj[scope.row.partsId].paperLength}}*
                                        {{props.row.cutModelObj[scope.row.partsId].paperWide}}
                                    </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="印数" align="center">
                                        <template slot-scope="scope">
                                            <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                                 {{props.row.cutModelObj[scope.row.partsId].printNums[0]}}
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="印张" align="center">
                                        <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                         {{props.row.cutModelObj[scope.row.partsId].printSheets[0]}}
                                    </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="单价" align="center">
                                        <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                        {{props.row.cutModelObj[scope.row.partsId].unitPrice}}
                                    </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="起步价" align="center">
                                        <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                        {{props.row.cutModelObj[scope.row.partsId].startPrice}}
                                    </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="工艺" prop="craftParamStr" align="center" ></el-table-column>
                                </el-table>
                            </template>
                        </el-table-column>

                        <el-table-column label="商品名称" prop="name" align="center">
                        </el-table-column>
                        <el-table-column
                                prop="addon"
                                label="规格/尺寸/材质/工艺"
                                width="600" align="center">
                            <template slot-scope="scope">
                                {{scope.row.addon}}
                            </template>
                        </el-table-column>
                        <el-table-column  prop="copy" label="款式" align="center">
                        </el-table-column>
                        <el-table-column  prop="nums" label="数量" align="center">
                        </el-table-column>
                        <el-table-column  prop="price" label="单价" align="center">
                        </el-table-column>
                        <el-table-column  prop="amount" label="总价" align="center">
                        </el-table-column>
                        <!--<el-table-column  prop="area_wide" label="优惠金额">
                        </el-table-column>
                        <el-table-column  prop="area_wide" label="应付金额">-->
                        </el-table-column>
                        <el-table-column  label="操作" align="center">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteGoods(scope.$index)" size="small"> 移除 </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </template>
            </div>
            <!--算价模块-->
            <div class="panel-heading">报价助手</div>
            <zy-calculate-price
                    ref="calculateEditPrice"
                    :fast = "categoryData.fast"
                    :print = "categoryData.print"
                    :is-edit="false"
                    @zy-add-goods = "zyAddGoods">
            </zy-calculate-price>

            <!--提交按钮-->
            <div  style="padding: 10px;padding-left: 45%">
                <el-button type="default" size="small" icon="el-icon-back" @click="reback">返回</el-button>
            </div>
        </form>
    </div>
    <!--添加产品dialog-->
    <el-dialog title="添加产品" :visible.sync="productDialogVisible" fullscreen  append-to-body>
        <el-container style="height: 700px; border: 1px solid #eee">
            <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
                <el-tree :data="categoryData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
            </el-aside>

            <el-container>
                <el-header style="text-align: left; font-size: 12px">
                    <el-row :gutter="20">
                        <el-col :span="10" >
                            <el-input placeholder="产品名称" size="small" v-model="q.productName">
                                <template slot="prepend">产品名称:</template>
                            </el-input>
                        </el-col >
                        <el-col :span="5" >
                            <el-button type="primary" size="small" icon="el-icon-search" @click="productSearch()">搜索</el-button>
                        </el-col >
                    </el-row>
                </el-header>

                <el-main>
                    <template>
                        <el-table
                                :data="goodsData"
                                border
                                max-height="250"
                                style="width: 100%">
                            <el-table-column
                                    fixed="left"
                                    label="操作"
                                    width="120">
                                <template slot-scope="scope">
                                    <el-button @click="addProduct(scope.row)" type="text" size="small">添加</el-button>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    prop="productId"
                                    label="产品编号"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    prop="productName"
                                    label="产品名称"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    prop="weight"
                                    label="重量"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    prop="craft"
                                    label="规格/尺寸/材质/工艺"
                                    width="200">
                            </el-table-column>
                            <el-table-column
                                    prop="pricingManner"
                                    label="计价方式"
                                    width="100"
                            >
                                <template scope="scope" v-if="scope.row.goodsType=='material'">
                                    <span>{{scope.row.pricingManner?"按周长计价":"按面积计价"}}</span>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    prop="unit"
                                    label="单位"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    prop="price"
                                    label="价格"
                                    width="120"
                            >
                            </el-table-column>
                            <el-table-column
                                    label="阶梯价格"
                            >
                                <template slot-scope="scope">
                                    <el-button @click="seeStepPrice(scope.row)"  v-show="scope.row.stepPrice!='[]'&&scope.row.stepPrice!=null&&scope.row.stepPrice!=''"  type="text" size="small">查看</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                    <!--下方table-->
                    <div style="margin-top: 5px;"><h4 style="color: #0f6ab4">选中商品详情</h4></div>
                    <template>
                        <el-table
                                :data="goodsTableData"
                                border
                                max-height="250"
                                style="width: 100%">
                            <el-table-column
                                    prop="productId"
                                    label="产品编号"
                                    width="80">
                            </el-table-column>
                            <el-table-column
                                    prop="productName"
                                    label="产品名称"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    prop="weight"
                                    label="重量"
                                    width="100">
                            </el-table-column>
                            <el-table-column
                                    prop="craft"
                                    label="规格/尺寸/材质/工艺"
                                    width="200">
                            </el-table-column>
                            <el-table-column
                                    prop="pricingManner"
                                    label="计价方式"
                                    width="200"
                                    :formatter="formatPricingManner">
                            </el-table-column>

                            <el-table-column
                                    label="长度或面积"
                                    width="200">
                                <template scope="scope" v-if="scope.row.goodsType=='material'">
                                    <el-input size="small"   @blur="changeArea(scope.row)" style="width:80px" v-model="scope.row.length" ></el-input>
                                    <span v-show="scope.row.pricingManner==0">* <el-input size="small"  @blur="changeArea(scope.row)" style="width:80px" v-model="scope.row.width" ></el-input>
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    prop="unit"
                                    label="单位"
                                    width="120">
                            </el-table-column>
                            <el-table-column
                                    prop="price"
                                    label="单价"
                                    width="120"
                            >
                            </el-table-column>
                            <!--  <el-table-column
                                      prop="copy"
                                      label="份数"
                                      width="120">
                              >
                                  <template scope="scope">
                                      <el-input size="small" @change="changCopy(scope.row)" v-model="scope.row.copy" ></el-input>
                                  </template>
                              </el-table-column>-->
                            <el-table-column
                                    prop="quantity"
                                    label="数量"
                                    width="120">
                                >
                                <template scope="scope" >
                                    <el-input size="small"  @keyup.native="changeQuantity(scope.row)" v-model="scope.row.quantity" ></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    prop="total"
                                    label="总价"
                                    width="120">
                                >
                                <template scope="scope">
                                    <el-input size="small" disabled v-model="scope.row.total" ></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    fixed="right"
                                    label="操作"
                            >
                                <template slot-scope="scope">
                                    <el-button @click="deleteProduct(scope.$index,goodsTableData)"   type="text" size="small">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                </el-main>
                <el-footer>
                    <el-row>
                        <el-col :span="5" :offset="4">
                            <el-button  type="primary" size="small" @click="addToMainTable">添加</el-button>
                            <el-button  type="primary" size="small" @click="cancelAdd">取消</el-button>
                        </el-col>
                    </el-row>
                </el-footer>
            </el-container>
        </el-container>
    </el-dialog>
    <!--阶梯价格-->
    <el-dialog title="阶梯价格" :visible.sync="stepPirceDialogVisible" width="30%"  append-to-body>
        <el-table :data="stepPriceData">
            <el-table-column property="minSum" label="起始数量" width="150"></el-table-column>
            <el-table-column property="maxSum" label="结束数量" width="200"></el-table-column>
            <el-table-column property="price" label="价格"></el-table-column>
        </el-table>
    </el-dialog>
    <!--单个商品详情-->
    <el-dialog title="详情" :visible.sync="orderItemDetailDialogVisible">
        <el-table :data="singleItemData"
                  border
        >
            <el-table-column property="addon" label="规格/尺寸/材质/工艺" width="150"></el-table-column>
            <el-table-column property="crafts_names" label="工艺名" width="150"></el-table-column>
        </el-table>
    </el-dialog>
    <!--销售价格展示-->
    <el-dialog
            title="销售价格"
            :visible.sync="quotePriceDialogVisible"
            width="40%"
            center
            append-to-body>
        <template>
            <div style="text-align: center">

                <el-radio  style="height: auto" v-for="(factoryQuoteInfo, index) in factoryQuoteInfoList" border v-model="printIndex" :label="index" @change="selectPrintGoods(index)">
                    <div>{{factoryQuoteInfo.quantity}}本</div>
                    <div style="margin-top: 5px">{{factoryQuoteInfo.unitPrice}}/本</div>
                    <div style="margin-top: 5px">{{factoryQuoteInfo.totalPrice}}元</div>
                </el-radio>
            </div>
            <div style="margin-top: 30px ;text-align: center"> 销售金额：<el-input placeholder="输入销售金额" v-model="printMoney" style="width:180px" clearable size="small"> </el-input></div>
        </template>
        <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="addPrintGoods" size="small">确 定</el-button>
  </span>
    </el-dialog>

    <!--快印印刷销售价格展示-->
    <el-dialog
            title="销售价格"
            :visible.sync="fastQuotePriceDialogVisible"
            width="20%"
            center
            append-to-body>
        <template>
            <div style="text-align: center">

                <el-radio  style="height: auto" v-for="(fastFactoryQuoteInfo, index) in fastFactoryQuoteInfoList" border v-model="fastIndex" :label="index" @change="selectPrintGoods(index)">
                    <div>{{fastFactoryQuoteInfo.quantity}}本</div>
                    <div style="margin-top: 5px">{{fastFactoryQuoteInfo.unitPrice}}/本</div>
                    <div style="margin-top: 5px">{{fastFactoryQuoteInfo.totalPrice}}元</div>
                </el-radio>
            </div>
            <div style="margin-top: 30px ;text-align: center"> 销售金额：<el-input placeholder="输入销售金额" v-model="fastMoney" style="width:180px" clearable size="small"> </el-input></div>
        </template>
        <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="addFastGoods" size="small">确 定</el-button>
  </span>
    </el-dialog>
    </el-dialog>
</div>
<script src="${request.contextPath}/statics/js/modules/order/erporderEdit.js?_${.now?long}"></script>